package com.glorystone.ins.service.impl;

import com.glorystone.ins.common.common.PageVo;
import com.glorystone.ins.dao.LogMpr;
import com.glorystone.ins.domain.Log;
import com.glorystone.ins.interceptor.PageList;
import com.glorystone.ins.service.LogSvr;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 项目名称：ins
 * 类名称：LogSvrImpl
 * 类描述：
 * 创建人：zgh
 * 创建时间：2018/4/12 10:59
 */
@Slf4j
@Service
@Transactional(readOnly = true,rollbackFor = Exception.class)
public class LogSvrImpl implements LogSvr{

    @Autowired
    private LogMpr logMpr;

    /**
     * 查询所有日志
     * @return
     * @param vo
     */
    @Override
    public PageList<Log> getLogList(PageVo vo) {
        return logMpr.getLogList(vo,vo.getPageable());
    }

    /**
     * 插入日志
     * @param log
     */
    @Override
    public void saveLog(Log log) {
        logMpr.insertSelective(log);
    }
}
